# --------------------------------
# -*- coding: utf-8 -*-
# Author: Zhu
# Date: 2021/12/17   
# Description:
# --------------------------------

import time
from Common.Base import Base
from Common.GetLog import GetLog
log = GetLog.get_logger()
from PageLocators.page_shopmanagement_loc import ele_SHOP_MANAGEMENT as loc

class fun_SHOP_MANAGEMENT(Base):
    u'作业端-基础资料-货主管理-【店铺管理】页面元素使用方法'

    def m_Shop_Management(self):
        '''
        点击店铺管理，打开店铺管理页面
        :return:
        '''
        log.info('点击店铺管理，打开店铺管理页面')
        print('点击店铺管理，打开店铺管理页面')
        self.base_click(loc.ys_Shop_Management)
        time.sleep(1)

    def m_CreateShop_Btn(self):
        '''
        点击新建店铺，打开新建店铺页面
        :return:
        '''
        log.info('点击新建店铺，打开新建店铺页面')
        print('点击新建店铺，打开新建店铺页面')
        self.base_click(loc.ys_CreateShop_Btn)
        time.sleep(1)

    def m_Input_ShopInfo(self,Shop_Name,Shop_Bm,Shop_Contact,Shop_ContactPhone,Shop_PhoneGH,Shop_Adress,Shop_Remark):
        '''
        开始输入店铺资料：店铺名称、店铺编码、联系人、联系人手机、联系人固话、店铺地址、备注
        :return:
        '''
        log.info('开始输入-店铺名称')
        print('开始输入-店铺名称')
        self.base_input(loc.ys_Shop_Name,Shop_Name)
        time.sleep(1)

        log.info('开始输入-店铺编码')
        print('开始输入-店铺编码')
        self.base_input(loc.ys_Shop_Bm,Shop_Bm)
        time.sleep(1)

        log.info('开始输入-联系人')
        print('开始输入-联系人')
        self.base_input(loc.ys_Shop_Contact,Shop_Contact)
        time.sleep(1)

        log.info('开始输入-联系人手机')
        print('开始输入-联系人手机')
        self.base_input(loc.ys_Shop_ContactPhone,Shop_ContactPhone)
        time.sleep(1)

        log.info('开始输入-联系人固话')
        print('开始输入-联系人固话')
        self.base_input(loc.ys_Shop_PhoneGH,Shop_PhoneGH)
        time.sleep(1)

        log.info('开始输入-店铺地址')
        print('开始输入-店铺地址')
        self.base_input(loc.ys_Shop_Adress,Shop_Adress)
        time.sleep(1)

        log.info('开始输入-备注')
        print('开始输入-备注')
        self.base_input(loc.ys_Shop_Remark,Shop_Remark)
        time.sleep(1)

    def m_Click_Openlist(self):
        '''
        点击存在下拉列表的选项
        :return:
        '''
        log.info('点击货主名称')
        print('点击货主名称')
        self.base_click(loc.ys_Shop_ShipperName)
        time.sleep(1)
        log.info('选择ui货主')
        print('选择ui货主')
        self.base_click(loc.ys_Shop_ShipperName2)
        time.sleep(1)

        log.info('点击销售平台')
        print('点击销售平台')
        self.base_click(loc.ys_Shop_SalePlatform)
        time.sleep(1)
        log.info('选择京东平台')
        print('选择京东平台')
        self.base_click(loc.ys_Shop_SalePlatform2)
        time.sleep(1)

    def m_Submit_Btn(self):
        '''
        点击提交新建店铺按钮
        :return:
        '''
        log.info('点击提交新建店铺按钮')
        print('点击提交新建店铺按钮')
        self.base_click(loc.ys_Submit_Btn)
        time.sleep(1)

